package com.cloud.api.domain.user;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cloud.api.myenum.SexEnum;
import com.cloud.core.entity.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * <p>
 * 车主信息表
 * </p>
 *
 * @author haohaibo
 * @since 2024-07-09
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("t_vehicle_owner")
@Schema(name = "VehicleOwner", description = "车主信息表")
public class VehicleOwner extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "id")
    @TableId("id")
    private String id;

    @Schema(description = "姓名")
    @TableField("name")
    @Size(max = 15, message = "{validation.name.size}")
    private String name;

    @Schema(description = "性别")
    @TableField("sex")
    private SexEnum sex;

    @Schema(description = "生日")
    @TableField("birthday")
    private LocalDate birthday;

    @Schema(description = "手机号")
    @TableField("mobile")
    @Pattern(regexp = "^1(3|4|5|6|7|8|9)\\d{9}$|^$",message = "{validation.common.phoneFormat}")
    private String mobile;

    @Schema(description = "配送地址")
    @TableField("ship_addr")
    @Size(max = 60, message = "{validation.shipAddr.size}")
    private String shipAddr;

}
